package edu.sctu.xialei.May.day20150529one;

import java.util.HashMap;
import java.util.Scanner;

/**
 * Created by Administrator on 5/29/2015.
 */
public class Call {

    public static void main(String[] args) {

//        初始化
        StudentInfoUtil studentInfoUtil = new StudentInfoUtil();

//        录入学生信息
        HashMap<Integer, StudentInfo> allStudentInfoMap = new HashMap<Integer, StudentInfo>();
        allStudentInfoMap = studentInfoUtil.setStudentInfo();

//        认证三好生
        allStudentInfoMap = studentInfoUtil.judgeSanHao(allStudentInfoMap);

//        提取三好生信息并打印
        System.out.println("\n\n下面是三好生信息：");
        HashMap<Integer, StudentInfo> sanHaoStudentInfoMap = new HashMap<Integer, StudentInfo>();
        sanHaoStudentInfoMap = studentInfoUtil.selectSanHaoStudent(allStudentInfoMap);
        new Printer().printStudentInfo(sanHaoStudentInfoMap);

//        提取指定地址的学生并打印
        Scanner input = new Scanner(System.in);
        System.out.println("\n\n输入你要检阅的地址：");
        HashMap<Integer,StudentInfo> addressOfTrueStudentMap = studentInfoUtil.judgeAddress(allStudentInfoMap,input.next());
        new Printer().printStudentInfo(addressOfTrueStudentMap);
    }
}
